package com.webshop.Utils;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ServletOut {

    /**
     * 转发返回
     * @param request
     * @param response
     * @param path
     */
    public static void request(HttpServletRequest request, HttpServletResponse response, String path) {
        String RootPath = request.getContextPath();
        try {
            request.getRequestDispatcher(path).forward(request, response);
        } catch (ServletException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
